package com.manlost.biz.argument;


import java.util.Collection;
import java.util.Map;

import com.manlost.biz.account.model.dataobject.Account;

/**
 * 断言工具类
 * 
 * @author kang.zhouk
 */
public final class Argument {

    private Argument() {
    }

    public static void isNotNull(Object object, String format, Object... args) {
        if (object == null) throw new IllegalArgumentException(String.format(format, args));
    }
    
    public static void isNull(Object object, String format, Object... args) {
        if (object != null) throw new IllegalArgumentException(String.format(format, args));
    }
    
    public static void positive(Integer argument, String format, Object... args) {
    	isNotNull(argument, format, args);
        if (argument.compareTo(new Integer(0)) <= 0) {
            throw new IllegalArgumentException(String.format(format, args));
        }
    }

    public static void main(String[] args) {
        // Argument.notNegative(0, "updatePersonByPrimaryKeySelective", "Person.getId()", "null");
    	try {
    		Argument.positive(null, "updatePersonByPrimaryKeySelective", "Person.getId()", "null");
    	} catch (Exception e) {
			e.printStackTrace();
		}
    }

    public static final String FORMAT = "The Method: %s Parameter: %s Value: %s";

}
